package com.dingdang.controller.admin.admin;

import com.dingdang.model.AdminLeftNav;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * 后台页面跳转控制类
 */
@Controller
@RequestMapping("/admin/systems")
public class SystemViewController {

    // 切换页面
    @RequestMapping("systemIndex")
    public String index(Model model,int index,String openPage) {
        List<AdminLeftNav> allAdminLeftNav2 = new ArrayList<AdminLeftNav>() {{
            add(new AdminLeftNav("系统用户", "systemIndex?index=0&openPage=systemFirstPage",0));
            add(new AdminLeftNav("系统角色", "systemIndex?index=1&openPage=role",0));
            add(new AdminLeftNav("app版本", "systemIndex?index=2&openPage=baoyangOrder",0));
            add(new AdminLeftNav("油站app", "systemIndex?index=3&openPage=baoyangOrder",0));
            add(new AdminLeftNav("参数设置", "systemIndex?index=4&openPage=baoyangOrder",0));
            add(new AdminLeftNav("城市日志", "systemIndex?index=5&openPage=baoyangOrder",0));
            add(new AdminLeftNav("城市管理", "systemIndex?index=6&openPage=baoyangOrder",0));
        }};
        allAdminLeftNav2.get(index).setIsActive(1);
        model.addAttribute("adminLeftNav", allAdminLeftNav2);
        model.addAttribute("isHeadActive", 0);
        model.addAttribute("openPage", openPage);
        return "admin/systemCenter";
    }

    @RequestMapping("systemFirstPage")
    public String firstPage(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/user";
    }

    @RequestMapping("role")
    public String role(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/role";
    }

    @RequestMapping("app")
    public String app(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/app";
    }
    @RequestMapping("gasstation_app")
    public String gasstation_app(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/gasstation_app";
    }
    @RequestMapping("option")
    public String option(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/option";
    }
    @RequestMapping("sys_log")
    public String sys_log(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/sys_log";
    }

    @RequestMapping("city")
    public String city(Model model) {
        model.addAttribute("ada1", "1");
        model.addAttribute("ada1", 1);
        return "admin/city";
    }

}
